﻿#include<iostream>
using namespace std;
typedef struct Role {
	short a;
	short b;
	int HP;
	int MP;
}*PRole, * XPole, _ROLE;
int main() {
	Role user;
	Role monster;
	PRole puser = &user;

	cout << sizeof(user) << endl;//12，因为内存会对齐，short的2字节不够int的4字节，如果只有a，那么就会空2字节用来对齐int的4字节

	monster.HP = 5000;
	user.HP = 500;
	user.MP = 50;

	cout << puser->HP << endl;
	puser->HP = 50;
	cout << puser->HP << endl;

	puser = &monster;
	cout << (*puser).HP << endl;

}